import { BaseWindow } from "../../../../component/window/BaseWindow";
import { ILayer } from "../../../../mvc/interfaces/ILayer";
import { Language } from "../../../../../extend/language/Language";
import { DisplayUtil } from "../../../../common/DisplayUtil";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { ObjCreate } from "../../common/ObjCreate";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../events/DataEvent";
import { EventName } from "../../../mvc/EventName";
import { SecTimerView } from "../../common/SecTimerView";
import { GButton } from "../../../../../com/mui/controls/GButton";
//class Lv88LeaveWin
    
    export  class Lv88LeaveWin extends BaseWindow
    {
        constructor(arg1: ILayer=null)
        {
            super(arg1);
            setSize(260, 150);
            this.title = Language.getString(27692);
            this.titleHeight = 27;
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            DisplayUtil.removeMe(_closeBtn);
            var loc1=GlobalStyle.textFormat1;
            loc1.align = flash.text.TextFormatAlign.CENTER;
            loc1.color = 16776960;
            loc1.leading = 3;
            this._leftTime = ObjCreate.createSecTimeView(Language.getString(80604), 50, 60, 160, 60, this, loc1);
            this._leftTime.setLeftTime(10);
            this._leftTime.timeOutHandler = this.timerOutHandler;
            this._leftTime.multiline = true;
            this._leftTime.wordWrap = true;
            this._btnOK = ObjCreate.createGButton(Language.getString(69901), 100, 105, 60, 24, this);
            this._btnOK.addEventListener(flash.events.MouseEvent.CLICK, this.clickMe);
            return;
        }

        /* internal  */clickMe(arg1: Object /* flash.events.MouseEvent */): void
        {
            this.hide();
            this.timerOutHandler();
            return;
        }

        public /* override */ hide(): void
        {
            super.hide();
            if (this._leftTime != null) 
            {
                this._leftTime.stop();
            }
            return;
        }

        /* internal  */timerOutHandler(): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.CopyLeaveWithoutComfirm));
            return;
        }

        /* internal */ /* var */_leftTime: SecTimerView;

        /* internal */ /* var */_btnOK: GButton;
    }
